﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace GameEngine.animations
{
    public class PostProcessEffect: ICloneable
    {
        public string name { get; set; }
        public Effect effect { get; set; }
        public EffectTechnique technique 
        {
            get { return effect.CurrentTechnique; }
            set { effect.CurrentTechnique = value; }
        }
        public int durationEffect { get; set; }

        public PostProcessEffect(string name, Effect effect, EffectTechnique technique, int duration)
        {
            this.name = name;
            this.effect = effect;
            this.technique = technique;
            this.durationEffect = duration;
        }
        public PostProcessEffect(string name, Effect effect, EffectTechnique technique) :
            this(name, effect, technique, 0)
        { }

        #region ICloneable Members

        public object Clone()
        {
            Effect clonedEffect = effect.Clone(effect.GraphicsDevice);
            PostProcessEffect ppe = new PostProcessEffect(name, clonedEffect, clonedEffect.Techniques[effect.CurrentTechnique.Name]);
            return ppe;
        }

        #endregion
    }
}
